﻿using System;

using System.Collections.Generic;
using System.Text;
using Silvermoon.Controls;

namespace System.Drawing
{
    public struct PointF
    {
        public static readonly PointF Empty = new PointF(0f, 0f);

        public float X;
        public float Y;

        public bool IsEmpty
        {
            get
            {
                return X == 0f && Y == 0f;
            }
        }

        public PointF(float x, float y)
        {
            X = x;
            Y = y;
        }

        public void Offset(float x, float y)
        {
            X += x;
            Y += y;
        }

        public override bool Equals(object obj)
        {
            if (!(obj is Point)) return false;

            Point b = (Point)obj;
            return b.X == X && b.Y == Y;
        }

        public override int GetHashCode()
        {
            return X.GetHashCode() ^ Y.GetHashCode();
        }

        #region operators

        public static bool operator ==(PointF a, PointF b)
        {
            return a.X == b.X && a.X == b.Y;
        }

        public static bool operator !=(PointF a, PointF b)
        {
            return a.X != b.X || a.X != b.Y;
        }
        #endregion
    }
}
